From 7ddc2369b20e6b9e4f067585d8c7389b33b00abb Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Mon, 10 Apr 2006 17:32:30 +0100 Subject: [PATCH] Fail the build if NR_hypercalls is not a power of two. Making this requirement clearer originally suggested by Muli Ben Yehuda. Signed-off-by: Keir Fraser --- xen/include/asm-x86/config.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h index 23aabeb2b9..35efb1ba63 100644 --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -65,8 +65,13 @@ #define barrier() __asm__ __volatile__("": : :"memory") +/* A power-of-two value greater than or equal to number of hypercalls. */ #define NR_hypercalls 32 +#if NR_hypercalls & (NR_hypercalls - 1) +#error "NR_hypercalls must be a power-of-two value" +#endif + #ifndef NDEBUG #define MEMORY_GUARD #ifdef __x86_64__ -- 2.30.2